/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo.datetime;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author VANDH
 */
public class Main {

    public static void main(String[] agrs) {
//        Date today = new Date(112, 11, 30);
//        System.out.println(today.toString());
//        System.out.println(today.toLocaleString());
//        System.out.println(today.toGMTString());
//
//        System.out.println(today.compareTo(new Date(113, 11, 30)));

        Calendar c = Calendar.getInstance();
        DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);

        c.set(2013, 9, 31);
        System.out.println(df.format(c.getTime()));
        try {
            //        c.set(Calendar.MONTH, 10);
            //        c.set(Calendar.DATE, 30);
            //        c.add(Calendar.MONTH, 3);
            //        c.roll(Calendar.MONTH, 4);
            Date d = df.parse("06/13/12 00:00 PM");
            System.out.println(d.toLocaleString());
        } catch (ParseException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println(df.format(c.getTime()));


    }
}
